﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MVCPets.Models.PetsListModel>" %>
<%@ Import Namespace="MVCPets.Helpers" %>
<%@ Import Namespace="MVCPets.Extensions" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Pets Index
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeaderContent" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2><%= Html.Encode(Model.Status.StatusDescription) %></h2>
    
    <% if (Model.Pets.Count > 0) foreach (var item in Model.Pets) Html.RenderPartial("PetsListItem", item); %>

    <% if (Request.IsAuthenticated && SessionHelper.UserRole <= RoleHelper.GetRoleValue("Contributor")) %>
    <% { %>
         <p><%= Html.ActionLink("[Create New]", "Create", "PetManagement") %></p>
    <% } %>
</asp:Content>